<template>
  <HModal :visible="visible" title="视图权限设置" @ok="close" @cancel="close">
    <RowAttribute label="新增" :span="24">
      <FormActioinSelector v-model="autoRelation.autoRefreshRelationEditAuth" action-type="add" :formDefinition="formDefinition"/>
    </RowAttribute>
    <RowAttribute :span="24" label="编辑">
      <FormActioinSelector v-model="autoRelation.autoRefreshRelationSaveAuth" action-type="edit" :formDefinition="formDefinition"/>
    </RowAttribute>
    <template #footer>
      <a-button @click="close">关闭</a-button>
    </template>
  </HModal>
</template>a
<script>
import HModal from '@comp/hhd/HModal/HModal.vue';
import {createProps} from '@/utils';
import {createAuto} from '@comp/hhd/design/relation/types';
import FormActioinSelector from '@comp/hhd/design/relation/AutoRelation/FormActioinSelector.vue';
import {createFormDefinition} from '@comp/hhd/design/FormDesigner/types';
import RowAttribute from '@comp/hhd/layout/RowAttribute.vue';
export default {
  name: 'AutoRelationAutoRefreshConfig',
  props: {
    formDefinition: createProps(Object, createFormDefinition),
    autoRelation: createProps(Object, createAuto),
  },
  components: {
    FormActioinSelector,
    RowAttribute,
    HModal,
  },
  data() {
    return {
      visible: false,
    }
  },
  methods: {
    open() {
      this.visible = true;
    },
    close() {
      this.visible = false;
    },
  }
}
</script>